# 357 中等：统计个位数字都不同的数字个数

def countNumbersWithUniqueDigits(n):
    if n == 0:
        return 1
    if n == 1:
        return 10

    num = 9
    # 排列组合
    for j in range(n - 1):
        num *= (9 - j)

    return num + countNumbersWithUniqueDigits(n - 1)


for i in range(8):
    print(countNumbersWithUniqueDigits(i))
